{% extends "base.html" %}
{% block content %}
<div class="row">

<div class="col-sm-12 clearfix">
    <img style="margin: 0 10px; height:64px; width:64px; float:left;" src={{request.user.avatar}}></img>
    <div>
        <p style=" margin-top:5px">
        <span style="font-size:25px">{{request.user.id}} - {{ request.user.username }}</span>
        <br/>
        <a href="/setting"> 賬號設置</a> | <a href="/logout"> 退出賬號</a>
        <br/>
        </p>
    </div>
</div>

{% set history = output.read_history %}
<div class="col-sm-12"><span class="legend">閱讀進度</span> </div>
<div class="col-sm-12">
    {% if history %}
    {% for book in history[:12] %}
    <div class="col-xs-4 col-sm-3 col-md-2">
        <a href="/book/{{book.id}}"><img class="center-block history-book-img" src="{{IMG}}/get/cover/{{book.id}}.jpg?t={{book.timestamp}}" alt="cover"/></a>
        <h5><a class="text-center history-book-title" href="/book/{{book.id}}">{{book.title}}</a></h5>
    </div>
    {% endfor %}
    {% else %}
    <p>沒有記錄</p> 
    {% endif %}
</div>
<div class="clearfix"></div>

{% set history = output.visit_history %}
<div class="col-sm-12"><span class="legend">瀏覽記錄</span> </div>
<div class="col-sm-12">
    {% if history %}
    {% for book in history[:12] %}
    <div class="col-xs-4 col-sm-3 col-md-2">
        <a href="/book/{{book.id}}"><img class="center-block history-book-img" src="{{IMG}}/get/cover/{{book.id}}.jpg?t={{book.timestamp}}" alt="cover"/></a>
        <h5><a class="text-center history-book-title" href="/book/{{book.id}}">{{book.title}}</a></h5>
    </div>
    {% endfor %}
    {% else %}
    <p>沒有記錄</p> 
    {% endif %}
</div>
<div class="clearfix"></div>

</div>
{% endblock %}

{% block sidebar %}
{% include "sidebar/basic.html" %}
{% endblock %}
